package com.zjm.principle.isp;

/**
 * 接口隔离原则
 * <p>
 * 不要把所有功能都放在一个大接口中，而是拆分成多个小接口。
 */
public class Segregation01 {
    public static void main(String[] args) {

    }
}

interface Printer {
    void print();
}

interface Scanner {
    void scan();
}

interface Copier {
    void copy();
}

interface FaxMachine {
    void fax();
}

class BasicPrinter implements Printer {
    public void print() {
        System.out.println("正在打印...");
    }
}

class SimpleScanner implements Scanner {
    public void scan() {
        System.out.println("正在扫描...");
    }
}

class ModernAllInOne implements Printer, Scanner, Copier, FaxMachine {
    public void print() {
        System.out.println("打印");
    }

    public void scan() {
        System.out.println("扫描");
    }

    public void copy() {
        System.out.println("复制");
    }

    public void fax() {
        System.out.println("传真");
    }
}
